﻿@model BlogSite.Models.Comment

@{
    ViewBag.Title = "EditComment";
}

<h2>EditComment</h2>


@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    
    <div class="form-horizontal">
        <h4>Comment</h4>
        <hr />
        @Html.ValidationSummary(true)
        @Html.HiddenFor(model => model.CommentId)
        @Html.HiddenFor(model => model.BlogId)
        <div class="form-group">
            @Html.LabelFor(model => model.Commenter, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Commenter)
                @Html.ValidationMessageFor(model => model.Commenter)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.TheComment, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.TheComment)
                @Html.ValidationMessageFor(model => model.TheComment)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.CommenterRating, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownListFor(model => model.CommenterRating, 
                Enum.GetValues(typeof(BlogSite.Models.Rating)).Cast<BlogSite.Models.Rating>().Select(v => new SelectListItem {
                    Text = v.ToString(), Value = ((int)v).ToString()}))
                @Html.ValidationMessageFor(model => model.CommenterRating)
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Save" class="btn btn-default" />
            </div>
        </div>
    </div>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
